@ECHO OFF
REM  QBFC Project Options Begin
REM  HasVersionInfo: Yes
REM  Companyname: MixSoft Programming
REM  Productname: MixSoft Programming Language Interpreter
REM  Filedescription: MXSPLI Launch
REM  Copyrights: Copyleft MixSoft Programming, d.o.o. 2016 (Licensed via GPLv3)
REM  Trademarks: MXSPLI is a trademark of MixSoft Programming
REM  Originalname: mxspli.bat
REM  Comments: See the license at: https://mxspli.codeplex.com/license
REM  Productversion:  1. 0. 5. 0
REM  Fileversion:  1. 0. 5. 0
REM  Internalname: mxspli
REM  Appicon: icon.ico
REM  AdministratorManifest: Yes
REM  QBFC Project Options End
ECHO ON
@echo off
:: MXSPLI-ShrareMX
:: MixSoft Programming Language Interpreter
:: Version v5_ShareMXv2
:: Developers: Mihail Mojsoski
call lang.bat
set mypath=%~dp0
FTYPE MXSPLI="%mypath%\prog.bat" "%1"
ASSOC .mcode=MXSPLI
if not exist files\nul md files
if not exist proc.bat set fupdate=1
if not exist prog.bat set fupdate=1
if not exist lang.bat set fupdate=1
if not exist debug.bat set fupdate=1
if exist prog.bat call prog.bat --vercheck
title %LNG_MXSPLI% %version%
SETLOCAL
cls
echo %LNG_WELC% %LNG_MXSPLI% %LNG_EDIT%
echo %LNG_UPCHK%
if exist updater.bat set update=bat
if exist updater.exe set update=exe
if exist "updater.%update%" set cupdate=1
if exist "updater.%update%" call updater
if "%fupdate%"=="1" (
	if not "%cupdate%"=="1" goto end
	call updater --force
)
:s
echo %LNG_PRJNME%
SET _prompt=%1
ECHO Wscript.Echo Inputbox("%LNG_PLSNTR%                                 %LNG_SPC%","%LNG_MXSPLI% %version%")>%TEMP%\~input.vbs
:s_GetInput
FOR /f "delims=/" %%G IN ('cscript //nologo %TEMP%\~input.vbs') DO set _string=%%G
DEL %TEMP%\~input.vbs
echo %LNG_CHKPRJ% "%_string%"...
if "%_string%"=="" goto s
for /f "tokens=2" %%a in ("%_string%") do goto s
if exist files\%_string%\nul goto true
cd editor
call createProject.bat %_string%
goto :end

:true
cd editor
set root=%cd%
echo %cd%
cd..
cd files
cd %_string%
set froot=%cd%
start "" "%root%\notepad++" -nosession "%froot%"
goto end

:end
ENDLOCAL & SET _input=%_string%
